import type {RouteRecordRaw} from "vue-router";

// 1、定义一个完整菜单的数据
export const allMenus = [
    {
        id: "1",
        title: "首页",
        path: "/Admin/Home"
    },
    {
        id: "2",
        title: "轮播图管理",
        children: [
            {
                id: "2-1",
                title: "轮播图列表",
                path: "/Admin/Banners"
            }
        ]
    },
    {
        id: "3",
        title: "操作员管理",
        children: [
            {
                id: "3-1",
                title: "操作人员列表",
                path: "/Admin/Person"
            }
        ]
    },
    {
        id: "4",
        title: "产品管理",
        children: [
            {
                id: "4-1",
                title: "秒杀列表",
                path: "/Admin/SecondsKill"
            },
            {
                id: "4-2",
                title: "推荐列表",
                path: "/Admin/RecommendList"
            },
            {
                id: "4-3",
                title: "筛选列表",
                path: "/Admin/SearchList"
            },
            {
                id: "4-4",
                title: "产品列表",
                path: "/Admin/GoodsList"
            },
            {
                id: "4-5",
                title: "产品详情",
                isShow:false
            },
            {
                id: "4-6",
                title: "产品详情Query",
                isShow:false
            }
        ]
    },
    {
        id: "5",
        title: "数据统计",
        children: [
            {
                id: "5-1",
                title: "K线图",
                path: "/Admin/KLineChart"
            },
            {
                id: "5-2",
                title: "柱状图",
                path: "/Admin/BarChart"
            }
        ]
    },
    {
        id: "6",
        title: "城市列表",
        path: "/Admin/Citys"
    },
    {
        id: "7",
        title: "useLink示例",
        path: "/Admin/useLinkDemo"
    },
    {
        id: "8",
        title: "$nextTick的回顾",
        path: "/Admin/nextTick"
    }
]

interface IMy{
    id:string
}

type MyRouteRecordRaw = RouteRecordRaw & IMy

// 2、定义所有的权限相关的路由配置

export const allroutes:MyRouteRecordRaw[] = [
    {
        id:"1",
        name:"HomeR",
        path:"",
        redirect:"/Admin/Home"
    },
    {
        id:"1",
        name:"Home",
        path:"Home",
        component:()=>import("../views/Admin/Home/index.vue")
    },
    {
        id:"2-1",
        name:"Banners",
        path:"Banners",
        component:()=>import("../views/Admin/Banners/index.vue")
    },
    {
        id:"3-1",
        name:"Person",
        path:"Person",
        component:()=>import("../views/Admin/Person/PersonList.vue")
    },
    {
        id:"4-4",
        name:"GoodsList",
        path:"GoodsList",
        component:()=>import("../views/Admin/Goods/GoodsList/GoodsList.vue")
    },
    {
        id:"4-5",
        name:"GoodsDetail",
        path:"GoodsDetail/:proid",
        component:()=>import("../views/Admin/Goods/GoodsList/GoodsDetail.vue")
    },
    {
        id:"4-6",
        name:"GoodsDetailQuery",
        path:"GoodsDetail",
        component:()=>import("../views/Admin/Goods/GoodsList/GoodsDetail.vue")
    },
    {
        id:"5-1",
        name:"KLineChart",
        path:"KLineChart",
        component:()=>import("../views/Admin/Total/KLineChart.vue")
    },
    {
        id:"5-2",
        name:"BarChart",
        path:"BarChart",
        component:()=>import("../views/Admin/Total/BarChart.vue")
    },
    {
        id:"6",
        name:"Citys",
        path:"Citys",
        component:()=>import("../views/Admin/Citys/index.vue")
    },
    {
        id:"7",
        name:"useLinkDemo",
        path:"useLinkDemo",
        component:()=>import("../views/Admin/useLinkDemo/index.vue")
    },
    {
        id:"8",
        name:"nextTick",
        path:"nextTick",
        component:()=>import("../views/Admin/nextTick/index.vue")
    }
]